<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>gespeaker dbus interface - /org/gtk/gespeaker/espeak</title>
  <link rel="stylesheet" href="style.css" type="text/css">
  <link rel="start" href="index.html" title="Gespeaker DBus API Reference Manual">
  <link rel="up" href="examples.html" title="Examples">
  <link rel="prev" href="examples.html" title="Examples">
  <link rel="next" href="examples_python.html" title="Python Examples">
</head>
<body link="#0000ff" alink="#0000ff" bgcolor="white" text="black" vlink="#840084">
  <div>
    <!-- header -->
    <table class="table_title">
      <tbody>
        <tr>
          <th colspan="3" align="center">org.gtk.gespeaker</th>
        </tr>
        <tr>
          <td align="left" width="20%"><a href="examples.html">Prev</a>&nbsp;</td>
          <th align="center" width="60%">gespeaker dbus interfaces</th>
          <td align="right" width="20%">&nbsp;<a href="examples_python.html">Next</a></td>
        </tr>
      </tbody>
    </table>
    <hr>
    <!-- end of header -->

    <div>
      <h2>Shell examples</h2>
      <p>Manage gespeaker through shell commands.<br>
        All DBus commands are sent with <span class="fixed">dbus-send</span> utility from the dbus package.</p>
      <p>To shorten typing the commands and to avoid repetitions the following variable is assumed:</p>
      <div class="fixed">OPTIONS=&quot;--print-reply --session --dest=org.gtk.gespeaker&quot;</div>
      <p>It will be used this way:</p>
      <div class="fixed">dbus-send $OPTIONS &lt;interface&gt; &lt;method&gt; [arguments]</div>
    </div>

    <div>
      <h2>Examples</h2>
      <table class="methods"><tbody class="method_definition"><tr><td>
    bool <a href="#is_playing">org.gtk.gespeaker.espeak.is_playing</a>()
    void <a href="#pause">org.gtk.gespeaker.espeak.pause</a>()
    void <a href="#play">org.gtk.gespeaker.espeak.play</a>()
    void <a href="#stop">org.gtk.gespeaker.espeak.stop</a>()
      </td></tr></tbody></table>
    </div>
  </div>
  <hr>

  <div>
    <a name="get_version"></a>
    <h3>Get Gespeaker version</h3>
    <p>Retrieve the application version number
      <div class="method_definition">dbus-send $OPTIONS /org/gtk/gespeaker org.gtk.gespeaker.get_version</div>
    </p>
    <table class="table_parameters"><col align="left" valign="top" width="10%"><tbody>
      <tr>
        <td class="method_parameters">Returns:</td>
        <td class="fixed">string &quot;0.8&quot;</td>
      </tr>
    </tbody></table>
  </div>

  <div>
    <a name="get_tempfilename"></a>
    <h3>Get temporary filename</h3>
    <p>Read the temporary filename
      <div class="method_definition">dbus-send $OPTIONS /org/gtk/gespeaker org.gtk.gespeaker.get_tempfilename</div>
    </p>
    <table class="table_parameters"><col align="left" valign="top" width="10%"><tbody>
      <tr>
        <td class="method_parameters">Returns:</td>
        <td class="fixed">string &quot;/tmp/gespeakerCLPQQ&quot;</td>
      </tr>
    </tbody></table>
  </div>

  <div>
    <a name="play_text"></a>
    <h3>Set new text and play it at once</h3>
    <p>
      <div class="method_definition">dbus-send $OPTIONS /org/gtk/gespeaker/ui org.gtk.gespeaker.ui.play_text string:&quot;Hello world&quot;</div>
    </p>
  </div>

  <div>
    <a name="play_text"></a>
    <h3>Set new text and play it with multiple steps</h3>
    <p>Clear previous text
      <div class="method_definition">dbus-send $OPTIONS /org/gtk/gespeaker/text org.gtk.gespeaker.text.clear</div>
    </p>
    <p>Add new text at the end
      <div class="method_definition">dbus-send $OPTIONS /org/gtk/gespeaker/text org.gtk.gespeaker.text.append string:&quot;world&quot;</div>
    </p>
    <p>Add some other text at the begin
      <div class="method_definition">dbus-send $OPTIONS /org/gtk/gespeaker/text org.gtk.gespeaker.text.prepend string:&quot;Hello &quot;</div>
    </p>
    <p>Play the whole text
      <div class="method_definition">dbus-send $OPTIONS /org/gtk/gespeaker/espeak org.gtk.gespeaker.espeak.play</div>
    </p>
    <p>Replace the text
      <div class="method_definition">dbus-send $OPTIONS /org/gtk/gespeaker/text org.gtk.gespeaker.text.replace string:&quot;Hello again&quot;</div>
    </p>
    <p>Play it again
      <div class="method_definition">dbus-send $OPTIONS /org/gtk/gespeaker/espeak org.gtk.gespeaker.espeak.play</div>
    </p>
  </div>

  <div>
    <a name="voices"></a>
    <h3>Get and set voices</h3>
    <p>List all available voices
      <div class="method_definition">dbus-send $OPTIONS /org/gtk/gespeaker/voice org.gtk.gespeaker.voice.list_all_voices</div>
    </p>
    <table class="table_parameters"><col align="left" valign="top" width="10%"><tbody>
      <tr>
        <td class="method_parameters">Returns:</td>
        <td class="fixed">array [<br>
          &nbsp;&nbsp;string &quot;afrikaans&quot;<br>
          &nbsp;&nbsp;string &quot;albanian&quot;<br>
          &nbsp;&nbsp;...<br>
          ]</td>
      </tr>
    </tbody></table>
    <p>List all availale mbrola voices
      <div class="method_definition">dbus-send $OPTIONS /org/gtk/gespeaker/voice org.gtk.gespeaker.voice.list_mbrola_voices</div>
    </p>
    <table class="table_parameters"><col align="left" valign="top" width="10%"><tbody>
      <tr>
        <td class="method_parameters">Returns:</td>
        <td class="fixed">array [<br>
          &nbsp;&nbsp;string &quot;english-mb-en1&quot;<br>
          &nbsp;&nbsp;string &quot;french-mbrola-4&quot;<br>
          &nbsp;&nbsp;string &quot;italian-mbrola-3&quot;<br>
          &nbsp;&nbsp;...<br>
          ]</td>
      </tr>
    </tbody></table>
    <p>Get the number of available voices
      <div class="method_definition">dbus-send $OPTIONS /org/gtk/gespeaker/voice org.gtk.gespeaker.voice.get_voices_count</div>
    </p>
    <table class="table_parameters"><col align="left" valign="top" width="10%"><tbody>
      <tr>
        <td class="method_parameters">Returns:</td>
        <td class="fixed">int32 59</td>
      </tr>
    </tbody></table>
    <p>Get the index of the currently selected voice
      <div class="method_definition">dbus-send $OPTIONS /org/gtk/gespeaker/voice org.gtk.gespeaker.voice.get_voice</div>
    </p>
    <table class="table_parameters"><col align="left" valign="top" width="10%"><tbody>
      <tr>
        <td class="method_parameters">Returns:</td>
        <td class="fixed">int32 31</td>
      </tr>
    </tbody></table>
    <p>Set the current voice by its index
      <div class="method_definition">dbus-send $OPTIONS /org/gtk/gespeaker/voice org.gtk.gespeaker.voice.set_voice int32:32</div>
    </p>
    <table class="table_parameters"><col align="left" valign="top" width="10%"><tbody>
      <tr>
        <td class="method_parameters">Returns:</td>
        <td class="fixed">boolean true</td>
      </tr>
    </tbody></table>
    <p>Get the name of the requested voice
      <div class="method_definition">dbus-send $OPTIONS /org/gtk/gespeaker/voice org.gtk.gespeaker.voice.get_voice_name int32:32</div>
    </p>
    <table class="table_parameters"><col align="left" valign="top" width="10%"><tbody>
      <tr>
        <td class="method_parameters">Returns:</td>
        <td class="fixed">string &quot;italian-mbrola-3&quot;</td>
      </tr>
    </tbody></table>
    <p>Set the current voice by its name
      <div class="method_definition">dbus-send $OPTIONS /org/gtk/gespeaker/voice org.gtk.gespeaker.voice.set_voice_by_name string:english</div>
    </p>
    <table class="table_parameters"><col align="left" valign="top" width="10%"><tbody>
      <tr>
        <td class="method_parameters">Returns:</td>
        <td class="fixed">boolean true</td>
      </tr>
    </tbody></table>
    <p>Get the short name of the requested voice
      <div class="method_definition">dbus-send $OPTIONS /org/gtk/gespeaker/voice org.gtk.gespeaker.voice.get_voice_short int32:32</div>
    </p>
    <table class="table_parameters"><col align="left" valign="top" width="10%"><tbody>
      <tr>
        <td class="method_parameters">Returns:</td>
        <td class="fixed">string &quot;mb-it3&quot;</td>
      </tr>
    </tbody></table>
    <p>Returns if the requested voice is a mbrola 
      <div class="method_definition">dbus-send $OPTIONS /org/gtk/gespeaker/voice org.gtk.gespeaker.voice.get_voice_is_mbrola int32:32</div>
    </p>
    <table class="table_parameters"><col align="left" valign="top" width="10%"><tbody>
      <tr>
        <td class="method_parameters">Returns:</td>
        <td class="fixed">boolean true</td>
      </tr>
    </tbody></table>
  </div>

  <!-- footer -->
  <div>
    <br>
    <hr>
    <table width="100%">
      <tbody>
        <tr>
          <td align="left" width="40%"><a href="examples.html">Prev</a>&nbsp;</td>
          <td align="center" width="20%"><a href="examples.html">Up</a></td>
          <td align="right" width="40%">&nbsp;<a href="examples_python.html">Next</a></td>
        </tr>
        <tr>
          <td align="left" valign="top" width="40%">Examples&nbsp;</td>
          <td align="center" width="20%"><a href="index.html">Home</a></td>
          <td align="right" valign="top" width="40%">&nbsp;Python Examples</td>
        </tr>
      </tbody>
    </table>
  </div>
</body>
</html>